import _00GraphFuc as gf
import _00GraphTreeFuc as gt

#用bitree(V)生成二叉树tree，并对其做遍历
n=20
V=range(n)
V=set(V)
tree=gt.bitree(V)
gtree=gt.tree2graph(tree)
gf.drawgraph(gtree)
preorderlist = gt.preordertraversal( tree)
inorderlist = gt.inordertraversal(tree)
postorderlist = gt.postordertraversal(tree)
print("tree",tree)
print("前序遍历",preorderlist)
print("中序遍历",inorderlist)
print("后序遍历",postorderlist)